


import {
    get,
    post,
    put,
  } from "./base_service"
  
  
  /**
   * 佳宝秒杀相关接口
   *
   * allen  2023-12-19
   */
  
  /**
   * 
   * 首页秒杀
   *
   * }
   */
  const homeSeckill = () => {
    return new Promise((resolve, reject) => {
      get("/api/front/seckill/index").then((data) => {
        if (data.code == 200) {
          resolve(data)
        } else {
          reject(data.message)
        }
      }).catch((e) => {
        reject(e.message)
      })
    })
  }
    /**
   * 
   * 秒杀页-秒杀活动配置
   *
   * }
   */
    const seckillConfig = () => {
        return new Promise((resolve, reject) => {
          get("/api/front/seckill/header").then((data) => {
            if (data.code == 200) {
              resolve(data)
            } else {
              reject(data.message)
            }
          }).catch((e) => {
            reject(e.message)
          })
        })
      }
  
      
  /**
   * 
   * 秒杀页-秒杀活动列表
   *
   * }
   */
  const seckillList = (id,page,limit=10) => {
    return new Promise((resolve, reject) => {
      get("/api/front/seckill/list/"+id+"?page="+page+"&limit="+limit).then((data) => {
        if (data.code == 200) {
          resolve(data)
        } else {
          reject(data.message)
        }
      }).catch((e) => {
        reject(e.message)
      })
    })
  }


  module.exports = {
    homeSeckill,
    seckillConfig,
    seckillList
  }
  
